package example

import (
	"go-amis-admin/admin"
	"go-amis-admin/amis"
)

type TodoView struct{}

func (t *TodoView) IndexView(ctx *admin.AdminContext) {
	tabs := amis.New("service").
		Set("api", "/admin/todo/getTodoList").
		Set("body", amis.New("tabs").
			Set("source", "${categories}").
			Set("tabs", []amis.Obj{
				{
					"title": "${Name}",
					"body": amis.New("list").Set("source", "${todoList}").Set("listItem", amis.New("hbox").Set("columns", []amis.Obj{
						{"name": "${Title}", "lable": "事项"},
					})),
				},
			}))
	page := amis.New("page").Set("body", tabs)
	ctx.Sucess(page, "")
}
